<!DOCTYPE html>
<!--[if IE]><![endif]-->
<!--[if IE 8 ]><html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" class="ie8"><![endif]-->
<!--[if IE 9 ]><html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
<!--<![endif]-->
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content= "<?php echo $keywords; ?>" />
<?php } ?>
<script src="catalog/view/javascript/jquery/jquery-2.1.1.min.js" type="text/javascript"></script>
<link href="catalog/view/javascript/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<script src="catalog/view/javascript/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<link href="catalog/view/javascript/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="catalog/view/theme/gd_default/stylesheet/stylesheet.css" rel="stylesheet">
<?php foreach ($styles as $style) { ?>
<link href="<?php echo $style['href']; ?>" type="text/css" rel="<?php echo $style['rel']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script src="catalog/view/theme/gd_default/javascript/common.js" type="text/javascript"></script>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<?php foreach ($scripts as $script) { ?>
<script src="<?php echo $script; ?>" type="text/javascript"></script>
<?php } ?>
<?php foreach ($analytics as $analytic) { ?>
<?php echo $analytic; ?>
<?php } ?>
</head>
<body class="<?php echo $class; ?>">
<nav id="top">
  <div class="container">
    <div class="pull-left top-left">
      <span href="<?php echo $contact; ?>"><i class="fa fa-phone"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $telephone; ?></span></span>
    </div>
    <?php echo $currency; ?>
    <?php echo $language; ?>
    <div id="top-links" class="nav pull-right">
      <ul class="list-inline">
        <li class="dropdown">
          <a href="<?php echo $account; ?>" title="<?php echo $text_account; ?>"><i class="fa fa-user"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $text_account; ?></span> <span class="caret"></span></a>
          <ul class="dropdown-menu dropdown-menu-right">
            <?php if ($logged) { ?>
            <li><a href="<?php echo $account; ?>"><i class="fa fa-user"></i><?php echo $text_account; ?></a></li>
            <li><a href="<?php echo $order; ?>"><i class="fa fa-calendar"></i><?php echo $text_order; ?></a></li>
            <li><a href="<?php echo $transaction; ?>"><i class="fa fa-credit-card"></i><?php echo $text_transaction; ?></a></li>
            <li><a href="<?php echo $download; ?>"><i class="fa fa-download"></i><?php echo $text_download; ?></a></li>
            <li><a href="<?php echo $logout; ?>"><i class="fa fa-sign-out"></i><?php echo $text_logout; ?></a></li>
            <?php } else { ?>
            <li><a href="<?php echo $register; ?>"><i class="fa fa-pencil" aria-hidden="true"></i><?php echo $text_register; ?></a></li>
            <li><a href="<?php echo $login; ?>"><i class="fa fa-sign-in" aria-hidden="true"></i><?php echo $text_login; ?></a></li>
            <?php } ?>
          </ul>
        </li>
        <li><a href="<?php echo $wishlist; ?>" id="wishlist-total" title="<?php echo $text_wishlist; ?>"><i class="fa fa-heart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $text_wishlist; ?></span></a></li>
        <li class="top-cart">
          <a href="<?php echo $shopping_cart; ?>" title="<?php echo $text_shopping_cart; ?>"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $text_shopping_cart; ?><i class="total-number"> (<?php echo $cart_total_number; ?>)</i></span></a>
          <?php echo $cart; ?>
        </li>
        <li><a href="<?php echo $checkout; ?>" title="<?php echo $text_checkout; ?>"><i class="fa fa-share"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $text_checkout; ?></span></a></li>
      </ul>
    </div>
  </div>
</nav>
<header>
  <div class="container header-container">
    <div class="header-wrap row">
      <div class="col-md-3 col-sm-12 col-xs-12">
        <div id="logo">
          <?php if ($logo) { ?>
          <a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" class="img-responsive" /></a>
          <?php } else { ?>
          <h1><a href="<?php echo $home; ?>"><?php echo $name; ?></a></h1>
          <?php } ?>
        </div>
      </div>
      <div class="col-md-7 col-sm-12 col-xs-12">
        <?php if ($categories) { ?>
        <div class="main-menu-wrapper">
          <div class="navbar-header">
            <div class="menu-search hidden-lg hidden-md">
              <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal"><i class="fa fa-search"></i></button>
            </div>
            <button type="button" class="btn btn-navbar navbar-toggle mobile-nav-icon"><i class="fa fa-bars"></i></button>
          </div>
          <div class="menu-box side-menu">
            <div class="side-search">
              <?php echo $search; ?>
            </div>
            <h2><?php echo $text_category; ?></h2>
            <ul class="main-menu">
              <?php foreach ($categories as $category) { ?>
              <?php if ($category['children']) { ?>
              <li class="parent dropdown">
                <span><i class="fa fa-angle-down" aria-hidden="true"></i></span>
                <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
                <div class="dropdown-menu">
                  <div class="dropdown-inner">
                    <?php foreach (array_chunk($category['children'], ceil(count($category['children']) / $category['column'])) as $children) { ?>
                    <ul class="list-unstyled">
                      <?php foreach ($children as $child) { ?>
                      <li><a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a></li>
                      <?php } ?>
                    </ul>
                    <?php } ?>
                  </div>
                </div>
              </li>
              <?php } else { ?>
              <li class="parent"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
              <?php } ?>
              <?php } ?>

        <?php if (!empty($blog)) { ?>
        <li class="parent dropdown"><a href="<?php echo $blog['href']; ?>" class="dropdown-toggle" data-toggle="dropdown"><?php echo $blog['name']; ?></a>
          <div class="dropdown-menu">
            <div class="dropdown-inner">
              <ul class="list-unstyled">
                <?php foreach ($blog['categories'] as $blog_category) { ?>
                <li><a href="<?php echo $blog_category['href']; ?>"><?php echo $blog_category['name']; ?></a></li>
                <?php } ?>
                <li><a href="<?php echo $blog['href']; ?>" class="see-all"><?php echo $text_all; ?> <?php echo $blog['name']; ?></a></li>
              </ul>
            </div>
        </li>
        <?php } ?>
      
            </ul>
          </div>
        </div>
        <?php } ?>
      </div>
      <div class="col-md-2 hidden-sm hidden-xs">
        <div class="header-search">
          <?php echo $search; ?>
        </div>
      </div>
    </div>
  </div>
</header>
<script>
  $(".mobile-nav-icon,.menu-search button").on('click', function () {
    $('.side-menu').addClass('active');
    $('body').addClass('body-overflow');
  });

  $(document).on('click', function (e) {
    var target = $(e.target);
    if (target.closest(".menu-box,.mobile-nav-icon,.menu-search button").length == 0) {
      $('.side-menu').removeClass('active');
      $('body').removeClass('body-overflow');
    }
  });

  $('.main-menu .parent span').click(function(event) {
    $(this).parent().siblings().removeClass('open active').children('.dropdown-menu').slideUp();
    $(this).parent().toggleClass('active').find('.dropdown-menu').slideToggle("fast");
  });
</script>
